using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace teste.Models.Mapping
{
    public class TesteLocMap : EntityTypeConfiguration<TesteLoc>
    {
        public TesteLocMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID, t.Codigo });

            // Properties
            this.Property(t => t.Codigo)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.NomeCliente)
                .HasMaxLength(50);

            this.Property(t => t.Cpf)
                .HasMaxLength(50);

            this.Property(t => t.Status)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("TesteLoc");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Codigo).HasColumnName("Codigo");
            this.Property(t => t.NomeCliente).HasColumnName("NomeCliente");
            this.Property(t => t.Cpf).HasColumnName("Cpf");
            this.Property(t => t.DataHoraEntrada).HasColumnName("DataHoraEntrada");
            this.Property(t => t.DataHoraSaida).HasColumnName("DataHoraSaida");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.Total).HasColumnName("Total");
            this.Property(t => t.Desconto).HasColumnName("Desconto");
            this.Property(t => t.ClienteID).HasColumnName("ClienteID");
            this.Property(t => t.DependenteID).HasColumnName("DependenteID");
            this.Property(t => t.VeiculoID).HasColumnName("VeiculoID");
            this.Property(t => t.VagaID).HasColumnName("VagaID");
            this.Property(t => t.TabelaPrecoID).HasColumnName("TabelaPrecoID");
        }
    }
}
